<?php 
session_start();

$retour = array();

if(isset($_POST['idQuestion']) && !empty($_POST['idQuestion']))
{
	$id = $_POST['idQuestion'];
	$val = $_SESSION['questions'][$id]['reps'];
	if($val)
		$retour["reponse"] = $val;
	else
		$retour["erreur"] = "Question plus valide";
	
	$retour["traitement"] = array();
	if( isset($_SESSION['questions'][$id]['traitement']) )
		$retour["traitement"] = $_SESSION['questions'][$id]['traitement'];
}else
{
	$retour['erreur'] = "Question introuvable";
}

echo json_encode($retour);

?>